/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.panels;

import Berekenen.Calc;
import Domain.MateriaalSoort;
import Domain.Prepreg;
import GUI.EditMaterial;
import GUI.EditPrepeg;
import Delta.Lamel;
import Delta.Layer;
import laminaatapplicatie.Global;

/**
 *
 * @author Memet
 */
public class LayerOperationPanel extends javax.swing.JPanel {

    Lamel lamel;
    /**
     * Creates new form LayerOperationPanel
     */
    public LayerOperationPanel() {
        initComponents();
        pnlData.setVisible(false);
        btnDelete.setEnabled(false);
        btnEdit.setEnabled(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlData = new javax.swing.JPanel();
        lblName = new javax.swing.JLabel();
        lblManufacturer = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        lblEl = new javax.swing.JLabel();
        lblGlt = new javax.swing.JLabel();
        lblEt = new javax.swing.JLabel();
        lblGltVal = new javax.swing.JLabel();
        lblElVal = new javax.swing.JLabel();
        lblNultVal = new javax.swing.JLabel();
        lblNult = new javax.swing.JLabel();
        lblEtVal = new javax.swing.JLabel();
        pnlExample = new Draw.pnlExample();
        btnMore = new javax.swing.JButton();
        lblH = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        btnEdit = new javax.swing.JButton();
        btnDelete = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        lblRho = new javax.swing.JLabel();
        lblAlphaVal2 = new javax.swing.JLabel();
        lblAlphaVal1 = new javax.swing.JLabel();
        lblAlpha2 = new javax.swing.JLabel();
        lblAlpha1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        lblERho = new javax.swing.JLabel();

        lblName.setFont(new java.awt.Font("Trebuchet MS", 1, 24)); // NOI18N
        lblName.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblName.setText("<Name>");

        lblManufacturer.setFont(new java.awt.Font("Trebuchet MS", 2, 14)); // NOI18N
        lblManufacturer.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblManufacturer.setText("<Manufacturer>");

        lblEl.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        lblEl.setText("El:");

        lblGlt.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        lblGlt.setText("Glt:");

        lblEt.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        lblEt.setText("Et:");

        lblGltVal.setText("<Glt> GPa");

        lblElVal.setText("<El> GPa");

        lblNultVal.setText("<vlt> GPa");

        lblNult.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        lblNult.setText("v12:");

        lblEtVal.setText("<Et> GPa");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(lblEl, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblGlt, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE)
                    .addComponent(lblEt, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE)
                    .addComponent(lblNult))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(lblElVal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblGltVal, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
                            .addComponent(lblEtVal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblNultVal))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEl)
                    .addComponent(lblElVal))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEt)
                    .addComponent(lblEtVal))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblGlt)
                    .addComponent(lblGltVal))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblNult)
                    .addComponent(lblNultVal))
                .addContainerGap(35, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout pnlExampleLayout = new javax.swing.GroupLayout(pnlExample);
        pnlExample.setLayout(pnlExampleLayout);
        pnlExampleLayout.setHorizontalGroup(
            pnlExampleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 50, Short.MAX_VALUE)
        );
        pnlExampleLayout.setVerticalGroup(
            pnlExampleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 20, Short.MAX_VALUE)
        );

        btnMore.setText("More...");
        btnMore.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMoreActionPerformed(evt);
            }
        });

        lblH.setText("<h> mm");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setText("Thickness:");

        btnEdit.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
        btnEdit.setText("Edit");
        btnEdit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditActionPerformed(evt);
            }
        });

        btnDelete.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
        btnDelete.setText("Delete");
        btnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        jLabel1.setText("ρ:");

        lblRho.setText("<html>Kg/m<sup>3</sup></html>");

        lblAlphaVal2.setText("<html>°C<sup>-1</sup></html>");

        lblAlphaVal1.setText("<html>°C<sup>-1</sup></html>");

        lblAlpha2.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        lblAlpha2.setText("αt:");

        lblAlpha1.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        lblAlpha1.setText("αl:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(lblAlpha2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblAlpha1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE))
                        .addGap(30, 30, 30)))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblRho, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                    .addComponent(lblAlphaVal2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(lblAlphaVal1, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
                        .addGap(2, 2, 2)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblAlphaVal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblAlpha1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblAlphaVal2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblAlpha2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(lblRho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(35, Short.MAX_VALUE))
        );

        jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 11)); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("E/ρ:");
        jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblERho.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblERho.setText("0");
        lblERho.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout pnlDataLayout = new javax.swing.GroupLayout(pnlData);
        pnlData.setLayout(pnlDataLayout);
        pnlDataLayout.setHorizontalGroup(
            pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDataLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(btnEdit, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnDelete, javax.swing.GroupLayout.Alignment.LEADING))
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblName, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)
                    .addComponent(lblManufacturer, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)
                    .addGroup(pnlDataLayout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlDataLayout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblH, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDataLayout.createSequentialGroup()
                                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblERho, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE))
                                .addGap(51, 51, 51)
                                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(pnlExample, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnMore))))))
                .addContainerGap())
        );
        pnlDataLayout.setVerticalGroup(
            pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDataLayout.createSequentialGroup()
                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnEdit)
                    .addComponent(lblName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblManufacturer)
                    .addComponent(btnDelete))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlDataLayout.createSequentialGroup()
                        .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(lblH))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(pnlExample, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addGroup(pnlDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(pnlDataLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(btnMore))
                            .addGroup(pnlDataLayout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(lblERho, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(10, 10, 10)))
                .addGap(29, 29, 29))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnMoreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMoreActionPerformed
//        showMaterialDetailsForm frm = new showMaterialDetailsForm();
//        frm.setMaterial(mat);
//        frm.setVisible(true);
    }//GEN-LAST:event_btnMoreActionPerformed

    private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
        
        
        if (lamel.isPrepreg())
        {
            EditPrepeg frm = new EditPrepeg();
            //frm.setMaterial((Prepreg) mat);
            frm.setMaterial(lamel);
            btnEdit.setEnabled(false);
            frm.setVisible(true);
        }
        else
        {
            EditMaterial frm = new EditMaterial();
            frm.setMaterial(lamel);
            btnEdit.setEnabled(false);
            frm.setVisible(true);
        }
    }//GEN-LAST:event_btnEditActionPerformed

    private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
        Global.data.deleteLamel(lamel);
        lamel = null;
        Global.menu.getLayerPane().clearSelection();
        this.updatePanel();
        Global.menu.refreshScreens();
    }//GEN-LAST:event_btnDeleteActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnDelete;
    private javax.swing.JButton btnEdit;
    private javax.swing.JButton btnMore;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel lblAlpha1;
    private javax.swing.JLabel lblAlpha2;
    private javax.swing.JLabel lblAlphaVal1;
    private javax.swing.JLabel lblAlphaVal2;
    private javax.swing.JLabel lblERho;
    private javax.swing.JLabel lblEl;
    private javax.swing.JLabel lblElVal;
    private javax.swing.JLabel lblEt;
    private javax.swing.JLabel lblEtVal;
    private javax.swing.JLabel lblGlt;
    private javax.swing.JLabel lblGltVal;
    private javax.swing.JLabel lblH;
    private javax.swing.JLabel lblManufacturer;
    private javax.swing.JLabel lblName;
    private javax.swing.JLabel lblNult;
    private javax.swing.JLabel lblNultVal;
    private javax.swing.JLabel lblRho;
    private javax.swing.JPanel pnlData;
    private Draw.pnlExample pnlExample;
    // End of variables declaration//GEN-END:variables
    public void setMateriaal(Lamel l)
    {
        this.lamel = l;
        updatePanel();
    }

    public void updatePanel()
    {
        
        if(lamel == null)
        {
            pnlData.setVisible(false);
            btnDelete.setEnabled(false);
            btnEdit.setEnabled(false);
        }
        else
        {
            if(!Global.data.lamelWordtGebruikt(lamel))
            {
                btnDelete.setEnabled(true);
            }
            else
            {
                btnDelete.setEnabled(false);
            }
            String el = "El:";
            String et = "Et:";
            String glt = "Glt:";
            String nult = "vlt:";
            String alphal = "αl:";
            String alphat = "αt:";
            if(!lamel.getType().equals(MateriaalSoort.UNIDIRECTIONAAL))
            {
                
                el = "E1:";
                et = "E2:";
                glt = "G12:";
                nult = "v12:";
                alphal = "α1:";
                alphat = "α2:";
            }

            lblName.setText(lamel.getName());
            lblManufacturer.setText(lamel.getManufacturer());
            pnlExample.setSet(lamel.getColorSet());
            pnlExample.setSoort(lamel.getType());
            lblEl.setText(el);
            lblEt.setText(et);
            lblGlt.setText(glt);
            lblNult.setText(nult);
            double e1 = lamel.getEl();
            double eRho = (e1/lamel.getRhol())/1e6;
            e1 = e1/1e9;
            double e2 = lamel.getEt()/1e9;
            double g12 = lamel.getGlt()/1e9;
            double nu12 = lamel.getMult();
            double alpha1 = lamel.getAlphaL();
            double alpha2 = lamel.getAlphaT();
            
            lblERho.setText(String.valueOf(Calc.Round(eRho, 2))+ " MPa/Kg");
            lblElVal.setText(String.valueOf(Calc.Round(e1, 2)) + " GPa");
            lblEtVal.setText(String.valueOf(Calc.Round(e2, 2)) + " GPa");
            lblGltVal.setText(String.valueOf(Calc.Round(g12, 2))+" GPa");
            lblNultVal.setText(String.valueOf(Calc.Round(nu12, 2)));
            lblRho.setText("<html>"+String.valueOf(Calc.Round(lamel.getRhol(), 2))+" Kg/m<sup>3</sup></html>");
            lblH.setText(String.valueOf(Calc.Round(lamel.getThickness(), 2))+" mm");
            lblAlpha1.setText(alphal);
            lblAlpha2.setText(alphat);
            lblAlphaVal1.setText("<html>"+String.valueOf(Calc.Round(alpha1,2))+" °C<sup>-1</sup></html>"); // <html>α [°C<sup>-1</sup>]</html>
            lblAlphaVal2.setText("<html>"+String.valueOf(Calc.Round(alpha2,2))+" °C<sup>-1</sup></html>");
            pnlExample.repaint();
            pnlData.setVisible(true);
            btnEdit.setEnabled(true);
        }

    }

    public void BtnEdit(boolean b)
    {
        btnEdit.setEnabled(b);
    }
}
